/*
 * login.css
 * 登录页面专用样式，主要用于美化login.html的登录表单、卡片、背景等。
 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 登录容器 */
.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-box {
  background: white;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  padding: 30px;
}

/* 登录头部 */
.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h2 {
  color: #333;
  font-size: 1.5em;
  margin-bottom: 10px;
}

.login-header p {
  color: #666;
  font-size: 0.9em;
}

/* 角色选择 */
.role-selection {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.role-btn {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.role-btn:hover {
  background: #e9ecef;
  border-color: #dee2e6;
  transform: translateY(-2px);
}

.role-btn i {
  font-size: 24px;
  color: #4a90e2;
}

.role-btn span {
  color: #495057;
  font-size: 0.9em;
}

/* 表单样式 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #495057;
  font-size: 0.9em;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group i {
  position: absolute;
  left: 12px;
  color: #adb5bd;
}

.input-group input {
  width: 100%;
  padding: 12px 12px 12px 40px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 0.9em;
  transition: border-color 0.3s ease;
}

.input-group input:focus {
  outline: none;
  border-color: #4a90e2;
}

#togglePassword {
  position: absolute;
  right: 12px;
  cursor: pointer;
  color: #adb5bd;
}

/* 错误消息 */
.error-message {
  color: #dc3545;
  font-size: 0.8em;
  margin-top: 5px;
  min-height: 20px;
}

/* 表单选项 */
.form-options {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 0.9em;
}

.form-options a {
  color: #4a90e2;
  text-decoration: none;
}

.form-options a:hover {
  text-decoration: underline;
}

/* 按钮样式 */
button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s ease;
}

#loginBtn {
  background: #4a90e2;
  color: white;
  margin-bottom: 15px;
}

#loginBtn:hover:not(:disabled) {
  background: #357abd;
}

#loginBtn:disabled {
  background: #b5c6e0;
  cursor: not-allowed;
  opacity: 0.7;
}

.back-btn {
  background: #f8f9fa;
  color: #495057;
  border: 1px solid #dee2e6;
}

.back-btn:hover {
  background: #e9ecef;
}

/* 登录结果 */
.login-result {
  margin-top: 15px;
  padding: 10px;
  border-radius: 6px;
  text-align: center;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9em;
}

.login-result.error {
  background: #f8d7da;
  color: #721c24;
}

.login-result.success {
  background: #d4edda;
  color: #155724;
}

/* 加载动画 */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 抖动动画 */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

.main-bg {
  width: 100vw;
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  z-index: 0;
  background: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%, #fbc2eb 100%);
  filter: blur(1px) brightness(1.05);
}
.container {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 12px 48px 0 rgba(80,120,200,0.18);
  padding: 48px 40px 32px 40px;
  width: 400px;
  max-width: 95vw;
  text-align: center;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.7s;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: none; }
}
.container h2 {
  margin-bottom: 32px;
  font-weight: 600;
  color: #2d3a5a;
  font-size: 24px;
  letter-spacing: 1px;
}
.form-group {
  text-align: left;
  margin-bottom: 18px;
  width: 100%;
}
.form-group input[type="text"],
.form-group input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #b5c6e0;
  border-radius: 6px;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
  transition: border 0.2s, box-shadow 0.2s;
  background: #f8fbff;
}
.form-group input:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px #e3f0ff;
}
.options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  font-size: 14px;
  width: 100%;
}
.options label {
  display: flex;
  align-items: center;
  cursor: pointer;
}
.options input[type="checkbox"] {
  margin-right: 5px;
  accent-color: #4a90e2;
}
.options a {
  color: #4a90e2;
  text-decoration: none;
  font-size: 13px;
}
.options a:hover {
  text-decoration: underline;
}
.login-btn {
  width: 100%;
  padding: 10px 0;
  background: #b5c6e0;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: not-allowed;
  margin-bottom: 16px;
  opacity: 0.7;
  letter-spacing: 1px;
  transition: background 0.2s;
}
.signup {
  font-size: 14px;
  color: #888;
  margin-bottom: 10px;
}
.signup a {
  color: #4a90e2;
  text-decoration: none;
  margin-left: 4px;
  font-weight: 500;
}
.signup a:hover {
  text-decoration: underline;
}
.waves {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 70px;
  z-index: 2;
  background: url('data:image/svg+xml;utf8,<svg width="100%" height="70" viewBox="0 0 1440 70" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 70C180 23.3333 360 23.3333 540 70C720 116.667 900 116.667 1080 70C1260 23.3333 1440 23.3333 1440 70V0H0V70Z" fill="%23c2e9fb"/></svg>') no-repeat bottom;
  background-size: cover;
  pointer-events: none;
}
.footer {
  position: fixed;
  left: 0; right: 0; bottom: 12px;
  width: 100vw;
  z-index: 3;
  font-size: 14px;
  color: #7a8ca5;
  display: flex;
  justify-content: center;
  gap: 24px;
  background: transparent;
  pointer-events: auto;
}
.footer a {
  color: #7a8ca5;
  text-decoration: none;
  transition: color 0.2s;
}
.footer a:hover {
  color: #4a90e2;
  text-decoration: underline;
}
@media (max-width: 600px) {
  .container {
    padding: 18px 2vw 18px 2vw;
    width: 99vw;
    min-width: unset;
  }
  .waves, .footer {
    font-size: 12px;
    height: 40px;
  }
}
/* 角色按钮组竖直排列美化 */
.role-btn-group {
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: center;
  margin: 0 auto 10px auto;
  width: 90%;
  max-width: 280px;
}
.role-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  width: 100%;
  padding: 18px 28px;
  font-size: 19px;
  font-weight: 500;
  border: none;
  border-radius: 14px;
  box-shadow: 0 2px 16px 0 rgba(80,120,200,0.10);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.13s;
  opacity: 1;
  margin: 0;
  outline: none;
  background: #f5f7fa;
  color: #333;
  position: relative;
}
.role-btn:not(:last-child)::after {
  content: '';
  display: block;
  position: absolute;
  left: 18px; right: 18px; bottom: -11px;
  height: 1.5px;
  background: linear-gradient(90deg, #e3f0ff 0%, #b5c6e0 100%);
  opacity: 0.5;
  border-radius: 1px;
}
.role-btn i {
  font-size: 24px;
  width: 36px;
  text-align: center;
  transition: color 0.2s, transform 0.2s;
}
.role-btn.manager-btn {
  background: linear-gradient(90deg, #e3f0ff 0%, #b5c6e0 100%);
  color: #205fa3;
}
.role-btn.doctor-btn {
  background: linear-gradient(90deg, #eafff0 0%, #b7eacb 100%);
  color: #237a4b;
}
.role-btn.admin-btn {
  background: linear-gradient(90deg, #fffbe6 0%, #ffe58f 100%);
  color: #ad6800;
}
.role-btn:hover, .role-btn:focus {
  box-shadow: 0 8px 28px 0 rgba(80,120,200,0.18);
  transform: translateY(-3px) scale(1.045);
  filter: brightness(1.07);
  z-index: 2;
}
.role-btn:hover i, .role-btn:focus i {
  color: #4a90e2;
  transform: scale(1.18) rotate(-8deg);
}
.role-btn span {
  flex: 1;
  text-align: left;
}
/* 输入框图标美化 */
.input-icon-group .input-wrapper {
  display: flex;
  align-items: center;
  background: #f8fbff;
  border: 1.5px solid #b5c6e0;
  border-radius: 6px;
  padding: 0 10px;
  transition: border 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  position: relative;
}
.input-icon-group .input-wrapper:focus-within {
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px #e3f0ff;
}
.input-icon-group i.fa-user,
.input-icon-group i.fa-lock {
  color: #b5c6e0;
  font-size: 18px;
  margin-right: 8px;
  min-width: 20px;
  transition: color 0.2s;
}
.input-icon-group .input-wrapper:focus-within i.fa-user,
.input-icon-group .input-wrapper:focus-within i.fa-lock {
  color: #4a90e2;
}
.input-icon-group input[type="text"],
.input-icon-group input[type="password"] {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  font-size: 15px;
  padding: 10px 0;
  box-shadow: none;
}
.toggle-password {
  cursor: pointer;
  color: #b5c6e0;
  font-size: 18px;
  margin-left: 8px;
  user-select: none;
  transition: color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
}
.toggle-password:hover {
  color: #4a90e2;
  transform: scale(1.18);
}
.input-icon-group .input-wrapper {
  margin-bottom: 0;
}
/* 错误提示美化 */
.error-msg, .login-error {
  color: #ff4d4f;
  background: #fff2f0;
  border: 1px solid #ffccc7;
  border-radius: 6px;
  padding: 8px 12px;
  margin: 10px 0 0 0;
  font-size: 15px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px 0 rgba(255,77,79,0.07);
  animation: shake 0.3s;
}
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}
/* 登录按钮 loading 效果 */
.login-btn.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}
.login-btn .loading-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid #fff;
  border-top: 2.5px solid #4a90e2;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
/* 响应式适配 */
@media (max-width: 600px) {
  .container {
    padding: 18px 2vw 18px 2vw;
    width: 99vw;
    min-width: unset;
  }
  .waves, .footer {
    font-size: 12px;
    height: 40px;
  }
  .role-btn-group {
    max-width: 98vw;
    width: 98vw;
  }
}
/* 回退按钮美化 */
.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #4a90e2;
  font-size: 15px;
  margin-bottom: 18px;
  cursor: pointer;
  transition: color 0.2s;
  outline: none;
  padding: 0 0 0 2px;
}
.back-btn i {
  font-size: 16px;
}
.back-btn:hover {
  color: #205fa3;
  text-decoration: underline;
}
/* 登录结果提示 */
.login-result {
  margin-top: 10px;
  font-size: 15px;
  min-height: 22px;
  text-align: left;
  color: #52c41a;
  display: flex;
  align-items: center;
  gap: 6px;
}
.login-result.error {
  color: #ff4d4f;
}
.login-result i {
  font-size: 16px;
}
.input-error {
  color: #ff4d4f;
  background: #fff2f0;
  border: 1px solid #ffccc7;
  border-radius: 6px;
  padding: 5px 10px;
  margin: 6px 0 0 0;
  font-size: 14px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
  box-shadow: 0 1px 4px 0 rgba(255,77,79,0.07);
  animation: shake 0.3s;
}
.input-error:empty {
  display: none;
}
.input-error i {
  font-size: 14px;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-container .input-wrapper {
    flex: 1;
}

#captchaCanvas {
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f8f9fa;
}

#captchaError {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
} 